﻿/*******************************************************************   
 * 创建日期：2021.07.09 11:12:25  
 * 创 建 者：Administrator 
 * 功能描述：DeadActor  
 *******************************************************************/
using System;


namespace Cars
{
    class ObstacleActor : Actor
    {
        char m_Name;

        ConsoleColor m_Color;

        public ObstacleActor(Position position, char name, ConsoleColor color) : base(position)
        {
            m_Name = name;
            m_Color = color;
        }

        public override void Draw()
        {
            Console.ForegroundColor = m_Color;
            Console.SetCursorPosition(m_Position.x, m_Position.y);
            Console.Write(m_Name);
        }

        public override void Move(Position deltPos)
        {
            base.Move(deltPos);

        }

        public override bool Dead()
        {
            return m_Position.x < 0 || m_Position.x >= Console.BufferWidth 
                || m_Position.y < 0 || m_Position.y >= Console.BufferHeight;
        }
    }
}
